feat: add MiniMax as LLM provider with Guardian threat protection#1
feat: add MiniMax as LLM provider with Guardian threat protection#1octo-patch wants to merge 1 commit intoOraclesTech:mainfrom
Conversation
Add MiniMax (https://www.minimax.io) as a first-class provider integration for Guardian SDK. MiniMax offers powerful LLM models (M2.7, M2.5) through an OpenAI-compatible API, and this provider wraps MiniMax-configured OpenAI clients with the same threat detection pipeline used for OpenAI and Anthropic. Changes: - Add minimax_provider.py with MiniMaxProvider, ProtectedMiniMaxClient, and create_protected_minimax_client() convenience factory - Add MiniMax auto-detection in get_provider_for_client() via base_url - Add minimax optional dependency group in pyproject.toml - Add MiniMax provider example and install instructions to README - Add 30 tests (22 unit + 5 integration + 3 constant tests)
|
Hey @octo-patch, really appreciate you taking the time to contribute to the Guardian SDK! It's clear you read the codebase carefully: the proxy structure, async/sync handling, and docstrings all follow the existing patterns closely, and the mock-based test suite is on par. Great first PR. Before we merge, there are two things that need to be addressed: guardian.py was not updated Fail-open on empty prompt (minimax_provider.py, line 283) Two smaller things worth a follow-up (not blocking): The base_url string match works here since it's nested inside the OpenAI module check, but a comment explaining the reasoning would help future maintainers. P.S sorry this took a little bit getting back to you! |
Summary
Add MiniMax as a first-class provider integration for Guardian SDK. MiniMax offers powerful LLM models (M2.7, M2.5) through an OpenAI-compatible API at
https://api.minimax.io/v1. This provider wraps MiniMax-configured OpenAI clients with the same multi-layer threat detection pipeline used for OpenAI and Anthropic.Changes
ethicore_guardian/providers/minimax_provider.py—MiniMaxProvider,ProtectedMiniMaxClient,ProtectedChat,ProtectedCompletions, andcreate_protected_minimax_client()convenience factoryget_provider_for_client()inbase_provider.pyto detect MiniMax clients by checkingbase_urlfor 'minimax'minimaxoptional dependency group inpyproject.toml(usesopenai>=1.0.0)tests/test_minimax.py— 22 unit tests + 5 integration tests + 3 constant testsSupported Models
Usage
Test plan